package com.tencent.wepay.protocol.pay.request;

import java.io.Serializable;

import com.tencent.wepay.annotation.NotBlank;
import com.tencent.wepay.annotation.SignIgnore;
import com.tencent.wepay.protocol.domain.XStreamDomain;
import com.tencent.wepay.util.RandomUtil;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamOmitField;
@XStreamAlias("xml")
public class RefundInfoRequest extends XStreamDomain implements Serializable{
	private static final long serialVersionUID = -1359995818440540317L;
	@NotBlank(desc="公众号或应用APPID不能为空")
	@XStreamAlias("appid")
	private String appid;
	@NotBlank(desc="商户号不能为空")
	@XStreamAlias("mch_id")
	private String mchId;
	@XStreamAlias("device_info")
	private String deviceInfo;
	@XStreamAlias("nonce_str")
	private String nonceStr=RandomUtil.uuid();
	@XStreamAlias("sign")
	@SignIgnore
	private String sign;
	@XStreamAlias("out_trade_no")
	private String tradeNo;
	@XStreamAlias("transaction_id")
	private String transactionId;
	@XStreamAlias("out_refund_no")
	private String outRefundNo;
	@XStreamAlias("refund_id")
	private String refundId;
	@XStreamOmitField
	@SignIgnore
	@NotBlank(desc="支付密钥不能为空")
	private String key;
	public String getAppid() {
		return appid;
	}
	public void setAppid(String appid) {
		this.appid = appid;
	}
	public String getMchId() {
		return mchId;
	}
	public void setMchId(String mchId) {
		this.mchId = mchId;
	}
	public String getDeviceInfo() {
		return deviceInfo;
	}
	public void setDeviceInfo(String deviceInfo) {
		this.deviceInfo = deviceInfo;
	}
	public String getNonceStr() {
		return nonceStr;
	}
	public void setNonceStr(String nonceStr) {
		this.nonceStr = nonceStr;
	}
	public String getSign() {
		return sign;
	}
	public void setSign(String sign) {
		this.sign = sign;
	}
	public String getTradeNo() {
		return tradeNo;
	}
	public void setTradeNo(String tradeNo) {
		this.tradeNo = tradeNo;
	}
	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}
	public String getTransactionId() {
		return transactionId;
	}
	public void setTransactionId(String transactionId) {
		this.transactionId = transactionId;
	}
	public String getOutRefundNo() {
		return outRefundNo;
	}
	public void setOutRefundNo(String outRefundNo) {
		this.outRefundNo = outRefundNo;
	}
	public String getRefundId() {
		return refundId;
	}
	public void setRefundId(String refundId) {
		this.refundId = refundId;
	}
	@Override
	public String toXML() {
		setSign(toSign(key));
		return super.toXML();
	}
}
